FROM node:18.17.0 as build-ui

COPY ./*.json /app/
COPY ./*.js /app/
COPY ./*.lock /app/

WORKDIR /app/

RUN yarn install

COPY . /app/

RUN yarn prebuild
RUN yarn build

FROM scratch

COPY --from=build-ui /app/dist /app/dist